import Mock from 'mockjs'

const order = Mock.mock({
  'list|10': [{
    'accountList': [
      {
        'accountId': '@id',
        'accountTitle|1': [1, 2, 3, 4],
        'accountType|1': [1, 2, 3, 4],
        'amount|1-99': 1,
        'fundDirection|1': [1, 2],
        'historyNo': '@id',
        'historyTime': '@now',
        'objectId': '@id',
        'objectType': [1, 2],
        'remark': '@title'
      }
    ],
    'appId': '@id',
    'appName': '@name',
    'appNo': '@id',
    'area': '@city',
    'city': '@city',
    'closeType': '关闭方式',
    'fzrUserName': '@cname',
    'lat|1-122.12123': 1,
    'linkMan': '@cname',
    'linkTel|1': ['15639288783', '15638323833'],
    'lng|1-122.12123': 1,
    'payAmount|1-99': 99,
    'province': '@province()',
    'releaseUserName': '@cname',
    'settledAmount|1-99': 1,
    'settledPayAmount|1-99': 1,
    'taskId': '@id',
    'taskMode|1': [1, 2],
    'taskName': '@csentence(3, 5)',
    'taskNo': '@id',
    'taskPlace': '@city',
    'taskStatus|1': [1, 2, 3, 4, 5, 6, 7, 8],
    'taskType': '任务类型',
    'totalAmount|1-99': 1,
    'unsettleAmount|1-999': 1,
    'unsettlePayAmount|1-999': 1,
    'workContent': '@csentence(3, 5)',
    'workType|1': [1, 2, 3]
  }]
})
const pub = {
  isMore: 0,
  pageIndex: 1,
  pageSize: 10,
  startIndex: 0,
  totalNum: 30,
  totalPage: 1
}
const dictMap = {
  workType: {
    1: '企业内部派单',
    2: '电力承包派单',
    3: '电力临时用工派单'
  },
  taskMode: {
    1: 'ttt',
    2: 'yyy'
  },
  customerType: {
    1: '22',
    2: '333'
  },
  accountType: {
    1: '平台',
    2: '机构',
    3: '电工'
  },
  accountTitle: {
    1: '余额',
    2: '可提现余额',
    3: '未结算应付',
    4: '未结算应收'
  },
  objectType: {
    1: '任务',
    2: '提前结算申请'
  },
  taskStatus: {
    1: '待付款',
    2: '待接单',
    3: '待开工',
    4: '待完工',
    5: '待确认',
    6: '待评价',
    7: '已完成',
    8: '已关闭'
  },
  matchStatus: {
    1: 'eee',
    2: '333'
  }
}
export default [
  {
    url: '/task/taskAccount/listUnsettledIncomeTaskByPage',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {
          ...order,
          ...pub
        },
        dictMap,
        msg: ''
      }
    }
  },
  // 未结算应付列表,网页用
  {
    url: '/task/taskAccount/listUnsettledPayTaskByPage',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {
          ...order,
          ...pub
        },
        dictMap,
        msg: ''
      }
    }
  }
//   {
//     url: '/task/task/viewWebTaskById',
//     type: 'get',
//     response: config => {
//       return {
//         code: 1,
//         data: {
//           ...order.list[0]
//         },
//         dictMap,
//         msg: ''
//       }
//     }
//   }
]
